package simportal.interceptor;

import javax.servlet.http.HttpSession;

import com.cfuture08.eweb4j.mvc.interceptor.Interceptor;

/**
 * 登陆验证拦截器
 * @author weiwei
 *
 */
public class LoginVerify extends Interceptor {

	public String intecept(String uri) {
		String error = null;
		HttpSession session = request.getSession(true);
		if (session.getAttribute("loginUser") == null) {
			String loginPath = "../login";
			error = "<script>alert('请先登陆'); window.location='"
					+ loginPath + "'</script>";
		}

		return error;
	}
}
